import React, { memo } from 'react'
import { useSearchParams } from 'react-router-dom'

const Test = memo(() => {
    const [query]=useSearchParams()
     const {title}=Object.fromEntries(query)
    const  s=window.location.href
    var d=s.split('?')[1].split('=');
    let f={}
    if(d.length>1){
      f[d[0]]=d[1]
    }
    console.log(f);
     const table=[{ name: '张三', sex: '男', age: 30, score: 100 }, { name: '李四', sex: '女',  age: 32, score: 80 }]
  return (
    <div>
       <p>{title}</p>
       <table border='1px' cellSpacing='0px'>
            {
              table.map(item=>(
             
                  <tr key={item}>
                  <td> {item.name}</td>
                  <td> {item.sex}</td>
                  <td> {item.age}</td>
                  <td> {item.score}</td>
                </tr>
               
                
              ))
            }
       </table>
    </div>
  )
})

export default Test